home *** CD-ROM | disk | FTP | other *** search
/ Backpacker 2 (Sweden) / BackPacker 2 (Sweden) (Disc 1).7z / BackPacker 2 (Sweden) (Disc 1).bin / pc / instdata / install.dxr / Internal_426.ls < prev    next >
Encoding:
Text File  |  1997-01-01  |  2.2 KB  |  81 lines

  1. on CheckCopyProcess
  2.   global gFileObj, gCopyID, gFileToCopy, gFileList, gPrevBytes, gBytes, gSrcPathList, gDestPathList
  3.   set done to GetStatus()
  4.   if done = 100 then
  5.     set gFileToCopy to gFileToCopy + 1
  6.     if gFileToCopy > count(gFileList) then
  7.       gFileObj(mCopyFileTaskDispose, gCopyID)
  8.       return 0
  9.       exit
  10.     else
  11.       set gPrevBytes to gPrevBytes + gFileObj(mCopyFileTaskBytesCopied, gCopyID)
  12.       gFileObj(mCopyFileTaskDispose, gCopyID)
  13.       set sourcepath to getAt(gSrcPathList, gFileToCopy)
  14.       set destPath to getAt(gDestPathList, gFileToCopy)
  15.       set srcFile to sourcepath & getAt(gFileList, gFileToCopy)
  16.       set DestFile to destPath & GetDestFileName(getAt(gFileList, gFileToCopy))
  17.       StartCopy(srcFile, DestFile)
  18.     end if
  19.   end if
  20.   set gBytes to gPrevBytes + gFileObj(mCopyFileTaskBytesCopied, gCopyID)
  21.   return 1
  22. end
  23.  
  24. on GetStatus
  25.   global gFileObj, gCopyID
  26.   set percentDone to gFileObj(mCopyFileTaskDoMore, gCopyID)
  27.   if percentDone = 101 then
  28.     CopyErr()
  29.     exit
  30.   end if
  31.   return percentDone
  32. end
  33.  
  34. on GetCopyInfo
  35.   global gFileObj, gCopyID, gFileToCopy, gFileList, gBytes, gSpaceNeeded, gProcKlart
  36.   set FilePercent to gFileObj(mCopyFileTaskPercentDone, gCopyID)
  37.   if FilePercent = 101 then
  38.     CopyErr()
  39.     exit
  40.   end if
  41.   if gFileToCopy > count(gFileList) then
  42.     set fileName to getAt(gFileList, count(gFileList))
  43.   else
  44.     set fileName to getAt(gFileList, gFileToCopy)
  45.   end if
  46.   set gProcKlart to integer(float(gBytes) / float(gSpaceNeeded) * 100)
  47.   set K to [gProcKlart, FilePercent, fileName]
  48.   return K
  49. end
  50.  
  51. on CopyErr
  52.   global gFileObj, gCopyID
  53.   if integerp(gCopyID) then
  54.     set err to gFileObj(mCopyFileTaskError, gCopyID)
  55.     ErrorDeCoder(err)
  56.   end if
  57.   go("FAIL")
  58. end
  59.  
  60. on CopyAbort
  61.   global gFileObj, gCopyID
  62.   if integerp(gCopyID) then
  63.     set K to gFileObj(mCopyFileTaskCancel, gCopyID)
  64.     CopyErr()
  65.     cleanUpFiles()
  66.   end if
  67.   go("FAIL")
  68. end
  69.  
  70. on cleanUpFiles
  71.   global gMiscObj, gFileObj, gFileList, gDestPathList, gDestPath
  72.   case the platform of
  73.     "Macintosh,68k", "Macintosh,PowerPC":
  74.       set fldr to "BackPacker 2:"
  75.     "Windows,16", "Windows,32":
  76.       set fldr to "BP2\"
  77.   end case
  78.   set path to gDestPath & fldr
  79.   gMiscObj(mDeleteFolder, path)
  80. end
  81.